const mongoose = require("mongoose");
const msgSchema = new mongoose.Schema({
    fid: String,
    tid: String,
    lastword: String,
    unreadnum: {type:Number,
    default: 0},

});

const userSchema = new mongoose.Schema({
    uid:String,
    loginTime:Number,
    logoutTime:Number,
    lastMsg:[msgSchema],
    isOnline:{
        type:Boolean,
        default:false
    }
});
const user = mongoose.model("user", userSchema);
module.exports = {
    user
};
